package com.wu.dao.impl;

import com.wu.bean.CategoryTable;
import com.wu.dao.CategoryTableDao;

import java.util.List;

public class CategoryTableDaoImpl extends BaseDao implements CategoryTableDao {
    @Override
    public List<CategoryTable> queryCategoryTableAll() {
        String sql="SELECT * FROM categorytable";
        return queryForList(CategoryTable.class,sql);
    }

    @Override
    public int AddCategoryTable(CategoryTable categoryTable) {
        String sql="INSERT INTO categorytable(categoryname)VALUES(?) ";
        return update(sql,categoryTable.getCategoryname());
    }

    @Override
    public int DeleteCategoryTable(int id) {
        String sql="DELETE FROM categorytable WHERE id=?";
        return update(sql,id);
    }
}
